package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.entity.NursingProject;
import com.zzyl.service.CustomerElderService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/customer/orders")
@Api(tags = "服务项接口")
public class CustomerElderController {
    @Autowired
    private CustomerElderService customerElderService;
    @GetMapping("/project/page")
    @ApiOperation("服务项分页查询")
    public ResponseResult<PageResponse<NursingProjectVo>> getByPage(String name,Integer pageNum,Integer pageSize,Integer status) {
           PageResponse<NursingProjectVo> nursingProjectInfo=customerElderService.getByPage(name,pageNum,pageSize,status);
           return  ResponseResult.success(nursingProjectInfo);
    }
    @GetMapping("/project/{id}")
    @ApiOperation("根据Id查询")
    public ResponseResult getByID(@PathVariable("id") Long id){
        NursingProject nursingProject =customerElderService.getById(id);
        return ResponseResult.success(nursingProject);
    }
}
